import Axios from '../utils/axios'
import api from '../api/index'
// 用户信息
function userInformation(){

    return Axios.get(api.userInformation.userInformation,{
    })
  }

  // 用户总数
function userzong(){

    return Axios.get(api.userInformation.userzong,{
    })
  }
   // 昨日用户总数
function zuserzong(){

    return Axios.get(api.userInformation.zuserzong,{
    })
}
   // 今日新增用户
function newuser(){

    return Axios.get(api.userInformation.newuser,{
    })
}
   // 昨日新增用户
function znewuser(){

    return Axios.get(api.userInformation.znewuser,{
    })
}
// 根据条件查询用户用户
function newuserInformatio(endTime:any,limit:any,page:any,startTime:any,username:any){
    // console.log(endTime+limit+page+startTime+username);
    return Axios.post(api.userInformation.newuserInformatio,{
        "endTime": endTime,
        "limit":limit,
        "page": page,
        "startTime":startTime,
        "username": username
    })
}
// 用户详细信息
function username(aid:any){

  return Axios.get(api.userInformation.username+"?id="+aid)
}

// 用户详细信息优惠卷和余额
function useryu(aid:any){

  return Axios.get(api.userInformation.useryu+"?userId="+aid)
}
// 用户详细信息资产
function usershoppding(aid:any){

  return Axios.get(api.userInformation.usershoppding+"?id="+aid)
}

// 修改用户姓名
function modifyname(id:any,name:any,phone:any){
  // console.log(endTime+limit+page+startTime+username);
  return Axios.post(api.userInformation.modifyname,{
    "id":id,
    "name":name,
    "phone":phone
  })
}
// 修改用户电话
function modifyphone(id:any,name:any,phone:any){
  // console.log(endTime+limit+page+startTime+username);
  return Axios.post(api.userInformation.modifyphone,{
    "id":id,
    "name":name,
    "phone":phone
  })
}
// 通过id查询分销商
// 用户详细信息资产
function idquerydistributor(aid:any){

  return Axios.get(api.userInformation.idquerydistributor+"?id="+aid)
}

// 查询全部分销商
function querydistributor(endTime:any,lever:any,limit:any,page:any,startTime:any){
  // console.log(endTime+limit+page+startTime+username);
  return Axios.post(api.userInformation.querydistributor,null,
    { params: { 
      'endTime':endTime, 'lever':lever,'limit':limit,'page':page,'startTime':startTime
    }
  })
}

// 用id查询分销商下线
function idxia(aid:any){

  return Axios.get(api.userInformation.idxia+"?id="+aid)
}

// 查询分销商下线列表
function idfenxia(id:any,lever:any,limit:any,page:any,){
  // console.log(endTime+limit+page+startTime+username);
  return Axios.post(api.userInformation.idfenxia,null,
    { params: { 
      'id':id, 'lever':lever,'limit':limit,'page':page
    }
  })
}

// 用id删除分销商下线
function deletfenxia(aid:any){

  return Axios.get(api.userInformation.deletfenxia+"?id="+aid)
}
  export default {
    userInformation,
    userzong,
    zuserzong,
    newuser,
    znewuser,
    newuserInformatio,
    username,
    useryu,
    usershoppding,
    modifyphone,
    modifyname,
    idquerydistributor,
    querydistributor,
    idxia,
    idfenxia,
    deletfenxia
  }